<template>
  <div>
	  

			<!-- 面包屑导航 -->
			<Breadcrumb :datas='datas'></Breadcrumb>

	<section class="featured-block text-center">
		<div class="container">
			<tr>
				<td style="padding:10px;">
					用户名:
				</td>
				<td>
					<input type="text" v-model="username">
				</td>
			</tr>
		
			<tr>
				<td>
					密码:
				</td>
				<td>
					<input type="password" v-model="password">
				</td>
			</tr>
			
					
			<tr>
				<td>
					
				</td>
				<td>
					<Button @click="submit">注册</Button>&nbsp;&nbsp;

					<Button @click="reset" color='green'>重置</Button>

				</td>
			</tr>
			
		</div>
	</section>
	
	<myfooter></myfooter>
    
  </div>
  
</template>

<script>
//导包

import myfooter from './myfooter'
export default {
  data () {
    return {
	  msg: "这是一个变量",
	  //声明面包屑变量
	  datas:[{title:'注册页面'}],
	  username:'',
	  password:'',
	  
    }
  },
  
//注册组件标签
components:{
	
	'myfooter':myfooter
},
  methods:{
	  //重置
	  reset:function(){
		  this.username = ''
		  this.password = ''
	  },

	  submit:function(){
		  if (this.username == ''){
			  this.$Message('用户名不能为空')
			  return false
		  }
		  if (this.password == ''){
			  this.$Message('密码不能为空')
			  return false
		  }
		  //像后端发送请求
		  this.axios.get('http://localhost:8000/register2',{params:{username:this.username,
		  password:this.password,code:this.code}}).then((result)=>{
			  	console.log(result);
				this.$Message(result.data.message)

		  })
	  },

     
  },

}


</script>
 
<style>



</style>